<!DOCTYPE html>
<html>
<head>
    <title>九宫格示例</title>
    <style>
        section {
            width: 300px;
            height: 300px;
        }

        div {
            position: absolute;
            width: 100px;
            height: 100px;
            border: 1px solid black;
            box-sizing: border-box;
        }

        div:nth-child(odd) {
            background-color: black;
            color: white;
        }

        div:nth-child(1) {top:0px; left:0px;}
        div:nth-child(2) {top:0px; left:100px;}
        div:nth-child(3) {top:0px; left:200px;}
        div:nth-child(4) {top:100px; left:0px;}
        div:nth-child(5) {top:100px; left:100px;}
        div:nth-child(6) {top:100px; left:200px;}
        div:nth-child(7) {top:200px; left:0px;}
        div:nth-child(8) {top:200px; left:100px;}
        div:nth-child(9) {top:200px; left:200px;}
    </style>
</head>
<body>
    <section>
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <div>7</div>
        <div>8</div>
        <div>9</div>
    </section>
</body>
</html>
